<?php 
/* SVN FILE: $Id: admin_search.ctp 65 2007-12-09 00:23:22Z joe.vasquez $ */
/**
 * admin view for search users
 * @filesource
 * @author			Joe Vasquez <joe.vasquez@gmail.com>
 * @copyright		Copyright (c) 2007, Joe Vasquez
 * @package			redlettr
 * @subpackage		users
 * @since			0.1A
 * @version			0.1A  $Rev: 65 $
 * @lastmodified	$Date: 2007-12-09 00:23:22 +0000 (Sun, 09 Dec 2007) $
 * @license			http://www.opensource.org/licenses/mit-license.php The MIT License
 */
?>
<?php echo $form->create('User',array('action' => 'search')); ?>
<?php echo $this->renderElement('searchForm',
	array(
		'searchFields' => array(
			'User.email' => array(
				'conditions' => array('exact','in','begin','end'),
				'id'		=> 'Email',
				'options'	 => array(
					'class' => 'textInput'
				)
			),
			'User.tries' => array(
				'conditions' => array(
					'exact',
					'less',
					'less or equal',
					'greater',
					'greater or equal',
					'not equal'
				),
				'id'		=> 'Tries',
				'options'	 => array(
					'class' => 'textInput'
				)				
			),
			'Profile.displayname' => array(
				'conditions' => array('exact','in','begin','end'),
				'id'		=> 'Display_Name',
				'options'	 => array(
					'class' => 'textInput'
				)				
			),
			'Profile.signature' => array(
				'conditions' => array('exact','in','begin','end'),
				'id'		=> 'Signature',
				'options'	 => array(
					'class' => 'textAreaInput'
				)				
			)
		)
	),
	true
); ?>
<?php echo $form->end('Search'); ?>
<?php if(isset($results)): ?>
<h2><?php echo count($results); ?> Result(s)</h2>
<div id="resultsContainer">
<dl>
	<?php if(count($results) > 0): ?>
		<?php foreach($results as $result): ?>
<dt><?php echo $result['User']['email']; ?></dt>
<dd>
<ul>
<li>
<strong>ID: </strong>
<?php echo $html->link(
	$result['User']['id'],
	'/'.Configure::read('Routing.admin').'/users/view/'.$result['User']['id']
); ?>
</li>
<li>
<strong>Email: </strong>
<?php echo $html->link(
	$result['User']['email'],
	'mailto:'.$result['User']['email']
); ?>
</li>
<li>
<strong>Login Tries: </strong>
<?php echo $result['User']['tries']; ?>
</li>
<li>
<strong>Created: </strong>
<?php echo $time->nice($result['User']['created']); ?>
</li>
<li>
<strong>Modified: </strong>
<?php echo $time->nice($result['User']['modified']); ?>
</li>
			<?php if(!empty($result['Profile']['displayname'])): ?>
<li>
<strong>Display Name: </strong>
<?php echo stripslashes($result['Profile']['displayname']); ?>
</li>			
			<?php endif; ?>
			<?php if(!empty($result['Profile']['signature'])): ?>
<li>
<strong>Signature: </strong>
<?php echo stripslashes(html_entity_decode($result['Profile']['signature'])); ?>
</li>			
			<?php endif; ?>			
</ul>
</dd>
		<?php endforeach; ?>
</dl>
</div>
	<?php endif; ?>
<?php endif; ?>